package Test;

import java.util.Objects;
import java.util.Scanner;

class student{
    String name;

    student(){}

    student(String n){
        super();
        this.name = n;
    }

    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof student)) return false;
        student student = (student) o;
        return getName().equals(student.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getName());
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        student s1 = new student("Mike");
        student s2 = new student("Mike");

//        System.out.println(s1.getClass());

//        System.out.println(s1.getClass().getName());
//        System.out.println(s1); // 默认调用Object类的toString方法
//
//        System.out.println(s1.hashCode() + "  --hash");
//        System.out.println(Integer.toHexString(s1.hashCode()) + " -- 16进制");
//
//        System.out.println(s1.getClass().getName());
//
//        System.out.println(s1.toString());
//
//        System.out.println(s1);

//        System.out.println(s1.equals(s2));
////        System.out.println(s1.hashCode() + " " + s2.hashCode());
//        char[] a = {'x', 'u', 'z', 'w', '1', '3', 'w', 'c', 'x', 'z'};
//        String s = new String(a);
//        System.out.println(s);
//        System.out.println(s.charAt(1));
//        char[] tmp = s.toCharArray();
//        for(char i : tmp){
//            System.out.print(i + " ");
//
//        }
//        System.out.println();
//        System.out.println(s.indexOf('x'));
//        System.out.println(s.indexOf('z'));
//        System.out.println(s.lastIndexOf('x'));

//        String s = "123,asd,141234,asd1";
//        String[] ss = s.split(",");
//        for(String i : ss){
//            System.out.println(i);
//        }
//        System.out.println();


    }
}
